<?php
namespace app\api\controller\wdsxh\single;

use app\admin\model\wdsxh\mall\Freight;
use app\common\controller\Api;
/**
 * 运费规则
 */
class FreightRules extends Api
{
    protected $noNeedLogin = ['*'];
    protected $noNeedRight = ['*'];

    public function index(){
        $param = $this->request->param();
        $where = [];
        $where['status'] = array('eq','normal');
        //单商城 = -1&&多商城=店铺id(store_id)
        if(isset($param['store_id']) && !empty($param['store_id'])) {
            $where['store_id'] = array('eq',$param['store_id']);
        }
        $data = (new Freight())
            ->where($where)
            ->field('id,min,max,price')
            ->select();
        $this->success('请求成功',$data);
    }

}